package com.engineering.elink.service.impl;

import javax.mail.MessagingException;

import org.springframework.stereotype.Service;

import com.engineering.elink.service.VerificationService;
import com.engineering.elink.util.auth.mail.MailSender;
import com.engineering.elink.util.auth.phone.PhoneSender;

@Service
public class VerificationServiceImpl implements VerificationService{

	@Override
	public void sendEmail(String emailAddress, String url) {
		try {
			MailSender.getMailSender().send(emailAddress, "乂联凌工-忘记密码通过邮箱验证", url);
		} catch (MessagingException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void sendPhoneCode(String phone, String code) {
		PhoneSender.send(phone, code);
	}

}
